package com.yan.demo04;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author yanheng
 * @data 2020/1/19 15:51
 */
public class CglibProxyClass implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("-----before-------");
        Object o1 = methodProxy.invokeSuper(o, objects);
        System.out.println("-----after--------");
        return o1;
    }
}
